<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>幼儿园Main后台</title>
</head>
<link rel="stylesheet" href="layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/mws.theme.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/mws.style.css" media="screen" />

<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>

<body>
<div>
<div id="story">
<div id="mws-header" class="clearfix">


    <div id="mws-logo-container">
        <div id="mws-logo-wrap">
            <img src="images/mws-logo.png" alt="mws admin" />
        </div>
    </div>


    <div id="mws-user-tools" class="clearfix" style="margin-right: 50px;">
        <div id="mws-user-info" class="mws-inset">
            <ul style="float: left;line-height: 35px;margin-left: 20px;">
                <li style="float: left;color: white;">
                    <span>部门：</span><span>{{garden_listName}}</span>
                </li>
            </ul>
           <ul class="layui-nav" style="background-color: rgba(255,255,255,0);float: right;">
               <li class="layui-nav-item" style="line-height: 37px;">
                   <a href="" style="color: white;">
                       {{userName}}
                       <span>{{roles}}</span>
                   </a>
               </li>
               <ul style="float: right;width: 60px;padding-top: 8px;box-sizing: border-box;">
               <li style="float: right;"><a href="Login.html" style="color: white;" onclick="if (confirm('确定要退出吗？')){sessionStorage.clear();}else{return false;} ">退出系统</a></li>
               </ul>

               </ul>
        </div>

    </div>
</div>

<!-- Main Wrapper -->
<div>
    <!-- Necessary markup, do not remove -->
    <div id="mws-sidebar-stitch"></div>
    <div id="mws-sidebar-bg"></div>

    <div id="mws-sidebar">


           <div style="width: 60px;margin-top:15px;height: 60px;margin-left: 15px;margin-bottom:35px;padding:8px;margin-left:53px;overflow:hidden;border-radius: 50%;background-image: url(images/core/mws-inset.png);box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.5);">
                <img :src="userPhoto" width="100%"/>
           </div>
        <!-- Main Navigation -->
        <div id="mws-navigation">
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li v-for="item in pers" class="layui-nav-item layui-nav-itemed">
                    <div class="oo" v-if="item.parentId != null">
                        <span class="moreyu">a</span>
                    </div>
                   <div v-if="item.parentId == null">
                        <a class="" href="javascript:;">{{item.perName}}</a>
                        <dl class="layui-nav-child">
                            <dd v-for="sec in pers">
                                <a v-if="sec.parentId == item.perId && sec.perType == 'menu'" :href="sec.perUrl" target="ifa">{{sec.perName}}</a>
                            </dd>
                        </dl>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div id="mws-container" class="clearfix">

            <div class="mws-report-container clearfix" style="position:absolute;left:200px;right:0;top:85px;bottom:0;z-index:998;width:auto;overflow:hidden;overflow-y:hidden;box-sizing:border-box;padding-left: 25px;padding-right: 25px;box-sizing: border-box;">
                <!-- 内容主体区域 -->
             <iframe src="system/user/userIndex.html" scrolling="no" style="width: 100%" height="100%" name="ifa" frameborder="0"></iframe>
            </div>
    </div>
</div>
</div>
</div>
<script src="/layui/layui.js"></script>
<script>

    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
    var vm = new Vue({
        el:'#story',
        data:{
            userName:'',
            userPhoto:'',
            login_user:null,
            garden_listName:null
        },
        created:function () {
            var User_PermissionData = JSON.parse(sessionStorage.getItem("login_user"));
            this.login_user = User_PermissionData;
            this.userName = User_PermissionData.kmsUser.userName;
            this.userPhoto=User_PermissionData.kmsUser.photo;
          /*  var a =User_PermissionData.kmsUser.garden_list;*/
            this.garden_listName = User_PermissionData.kmsUser.garden_list == null ? '总部' : User_PermissionData.kmsUser.garden_list.glName;
            /*if (a == null){
                this.garden_listName = '总部';
            } else {
                this.garden_listName=a.glName;
            }*/
        },
        computed:{
            roles:function(){
                let str = "[";
                for(let role of this.login_user.kmsUser.kmsRoles){
                    str += role.roleName + " | ";
                }
                return str+"]";
            },
            pers : function () {
                return this.login_user.kmsPermissions;
            }
        }
    })
    $(".moreyu").parent(".oo").parent(".layui-nav-item").remove();
</script>
</body>
</html>